package com.ccys.db.mapper;

import com.ccys.db.dto.doctor.completedOrEndCall.CheckNotEnoughInInventory;
import com.ccys.db.dto.doctor.doctorConsultStage.ReplacePrescriptionDto;
import com.ccys.db.dto.web.productAndService.ProductDto;
import com.ccys.db.entity.TblInventoryFeed;
import com.ccys.db.entity.TblProduct;
import com.ccys.db.vo.app.splashscreen.GetMedicationVo;
import com.ccys.db.vo.doctor.consultStage.*;
import com.ccys.db.vo.doctor.doctorConsultStage.CheckProductVo;
import com.ccys.db.vo.doctor.doctorConsultStage.ReplacePrescriptionFindProductVo;
import com.ccys.db.vo.web.inventory.ProductInfoVo;
import com.ccys.db.vo.web.productAndService.GetProductListVo;
import com.ccys.db.vo.web.productAndService.ProductVo;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
import tk.mybatis.mapper.common.MySqlMapper;

import java.util.List;
import java.util.Map;

/**
* Created by Mybatis Generator on 2023/12/08
*/
public interface TblProductMapper extends Mapper<TblProduct>, MySqlMapper<TblProduct> {

    List<ProductVo> getList(ProductDto dto);

    void updateBatchImportQuantity(@Param("productList") List<TblProduct> productList);

    void increaseImportQuantity(Integer quantity,String id);

    void decreaseImportQuantity(Integer quantity,String id);

    ProductInfoVo getProductInfo(String productId);

    void updateStockQuantityByAdjust(TblInventoryFeed model);

    void deleteIngredients(String productId);

    List<GetMedicationVo> findListProductAndPackageUnionAll();

       /**
        * @description 查询产品Id和name
        * @date     2024/1/31
        * @author   cloud fly
        */
    List<Map<String, String>> getIdAndName(String whereByIds);


    List<GetProductListVo> getProductList(String groupId);


    List<GetMedicationFavouriteWithCountryVo> getMedicationFavouriteWithCountry(String doctorId);


    List<GetMedicationForCdmpVo> getMedicationForCdmp();

    List<GetMedicationWithCountryVo> getMedicationWithCountry(String bookingId);

    List<GetMedicationWithCountryVo> getMedicationWithIsExclusionList(String bookingId);


    List<GetMedicationByPackageVo> getMedicationByPackage(String packageId);

    List<GetMedicationFavouriteWithCountryVo> getMedicationFavouritePrescription(String doctorId);


    List<GetMedicationGoApotikVo> getMedicationGoApotik(String searchText);

    GetMedicationGoApotikDetailVo getMedicationGoApotikDetail(String productId);


    List<GetMedicationGroupVo> getMedicationGroup();


    List<GetIndoSPMedicationVo.IndoSPMedicationVo> getIndoSPMedication();

    TblProduct findById(@Param("productId") String productId);

    Integer findCountByStatusIsTrueByIds(@Param("productIds") List<String> productIds);

    List<CheckProductVo> findCheckByProduct(@Param("checkProduct") List<ReplacePrescriptionDto.Prescription> checkProduct,@Param("bookingId") String bookingId);

    List<CheckProductVo> findCheckTwo(@Param("checkProduct") List<ReplacePrescriptionDto.Prescription> checkProduct,@Param("bookingId") String bookingId);

    List<String> findCheckThree(@Param("checkProduct") List<ReplacePrescriptionDto.Prescription> checkProduct,@Param("memberId") String memberId);

    List<ReplacePrescriptionFindProductVo> findProductNameByIds(@Param("productIds") List<String> productIds);

    /**
     * 线下问诊！！！！
     * 检查药品库存的方法 这个方法会not in product表的country_id不等于传入的countryId
     *
     * @param bookingId booking
     * @param countryId 国家id
     * @return
     */
    List<CheckNotEnoughInInventory> findCheckNotEnoughInInventory(@Param("bookingId") String bookingId,@Param("countryId") String countryId);
}
